import { http } from "./http";
// 获取分类
export const getContestClass = async (data) => {
    return await http({
        url: "/contestclass/getList",
        method: 'GET',
        headers: {},
        data,
    })
}
// 获取轮播图
export const getBanner = (data) => {
    return http({
        url: "/carousel/getList",
        method: 'GET',
        data,
    })
}
// 获取赛事数据
export const getContestList = (params) => {
    return http({
        url: `/contest/getPage`,
        method: 'GET',
        params,
    })
}
// export const getSearchList = (data) => {
//     return http({
//         url: `/contest/getPage/?keyword=${data.keyword}`,
//         method: 'GET',
//         data,
//     })
// }
// 注册
export const getRegister = (data) => {
    return http({
        url: "/user/register",
        method: 'POST',
        data,
    })
}
// 登录
export const getLogin = (data) => {
    return http({
        url: "/user/login",
        method: 'POST',
        data,
    })
}

// 详情
export const getContestInfo = (data) => {
    return http({
        url: `/contest/getInfo?id=${data.id}`,
        method: 'GET',
        data,
    })
}

// 获取个人信息
export const getUserInfo = (data) => {
    return http({
        url: '/user/getInfo',
        method: 'GET',
        data,
    })
}

// 修改个人信息
export const getUpdateInfo = (data) => {
    return http({
        url: '/user/updateInfo',
        method: 'POST',
        data,
    })
}
// 修改密码
export const getUpdatePassword = (data) => {
    return http({
        url: '/user/updatePassword',
        method: 'POST',
        data,
    })
}

// 报名信息
export const getEnrollLogPage = (data) => {
    return http({
        url: `/enrolllog/enrollInfo?cid=${data.cid}`,
        method: 'GET',
        data,
    })
}

// 提交报名
export const getEnroll = (data) => {
    return http({
        url: '/enrolllog/enroll',
        method: 'POST',
        data,
    })
}

// 报名列表
export const getMyEnrollLogPage = (data) => {
    return http({
        url: '/enrolllog/getMyEnrollLogPage',
        method: 'GET',
        data,
    })
}

// 文件上传
export const getUploadFile = (data) => {
    return http({
        url: '/common/uploadFile',
        method: 'POST',
        data,
    })
}

export const getSubmitFile = (data) => {
    return http({
        url: '/enrolllog/submitFile',
        method: 'POST',
        data,
    })
}

// 是否报名
export const getIsEnroll = (data) => {
    return http({
        url: `/enrolllog/isEnroll?cid=${data.cid}`,
        method: 'GET',
        data,
    })
}